<%-- 
    Document   : loanCollectionContent
    Created on : May 4, 2011, 2:12:01 AM
    Author     : MacBook
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>


<s:div id="collection" cssStyle="height:460px">
    <s:set name="stat" value="actstatus"/>
    <s:set name="prev" value="statprevious"/>
    <s:set name="view" value="view"/>

    <s:if test="%{#privilegeView.allowable == false}">
        <script type="text/javascript">window.location="home.jsp";</script>
    </s:if>
    <s:if test="%{#privilegeCreate.allowable == false}">
        <dl class="ui-state-highlight ui-corner-all" style="clear:both">
            <dt><span class="ui-icon ui-icon-info"></span>You are not allowed to create in this module.</dt>
        </dl>
        <script type="text/javascript">
            $(document).ready(function(){
                $('#btmbutton').css("margin-top","26em");
                $('#savebtn').attr("disabled","disabled");
                $('#postcollbtn').attr("disabled","disabled");
                $('#viewcollection').attr("disabled","disabled");
                $('#viewall').attr("disabled","disabled");
                $('#createnew').attr("disabled","disabled");
            });
        </script>
    </s:if>
    <div id="searchdiv" style="display: none">
        <s:form id="getsequ" action="get-seq" cssStyle="clear:left;margin-left:1em;float:left;clear:right;font-size:12px;width:20em">
            <script type="text/javascript">
                $(document).ready(function(){
                    $('#go').click(function(e){
                    
                        var sequence = $('#search').val();
                        if(sequence==''){
                            alert('Sequence Number is not specified');
                            document.getElementById('getsequ').submit= false;
                        }else if(isNaN(sequence)){
                            alert('Pls enter a valid Sequence Number');
                            document.getElementById('getsequ').submit= false;
                        }else{
                            document.getElementById('getsequ').submit();
                        }
                    });
                });

            </script>
            <s:label cssStyle="font-style:italic;font-size:12px;float:left;clear:right">Search by Sequence:</s:label>
            <s:textfield name="sampleseq" id="search" label="Sequence" cssClass="sampleseq" title="Sequence Number" cssStyle="float:left;clear:left"/>
            <sj:submit id="go" button="true" cssClass="ui-state-default" cssStyle="font-size:12px;float:right" value="Search"/>
        </s:form>

        <s:form action="search-coll" cssStyle="float:left;font-size:12px;width:30em;margin-left:3em">
            <s:label cssStyle="font-style:italic;font-size:12px;float:left">Search by Date & Area Code:</s:label>
            <s:textfield name="date" id="date" cssClass="sampleseq" title="Date" label="Date" cssStyle="float:left"/>
            <s:textfield name="areacode" id="areacode" cssClass="sampleseq" title="Area Code" label="Area Code" cssStyle="float:left"/>
            <sj:submit id="go" button="true" cssClass="ui-state-default" cssStyle="margin-left:15em" value="Search"/>
        </s:form>

    </div>

    <%--<s:if test="%{#authorized!=undefined}">
        <s:if test="%{#authorized=='no'}">
            <dl class="ui-state-highlight ui-corner-all" style="clear:both">
                <dt><span class="ui-icon ui-icon-info"></span>You are not authorized to create in this module.</dt>
            </dl>
        </s:if>
    </s:if>--%>
    <s:if test="%{#stat!=undefined}">
        <s:if test="%{#stat!='ok'}">
            <dl class="ui-state-error ui-corner-all">
                <dt><span class="ui-icon ui-icon-alert"></span><s:property value="#stat"/></dt>
            </dl>
        </s:if>
        <s:elseif test="%{#stat=='ok'}">
            <dl class="ui-state-highlight ui-corner-all" style="clear:both">
                <dt><span class="ui-icon ui-icon-info"></span>Collection posted!</dt>
            </dl>
            <script type="text/javascript">
                $(document).ready(function(){
                    $('#btmbutton').css("margin-top", "27em");
                });
            </script>
            <s:form name="viewcollect" action="view-coll" cssStyle="font-size:12px;width:800px;clear:both" theme="simple">
                <s:div id="collinfo" style="float: left; width: 800px;font-size:12px;margin-left:2em;">
                    <table>
                        <tr>
                            <td><s:label>Branch Code</s:label></td>
                            <td><s:textfield label="Branch Code" type="text" id="b" cssClass="branchid" readonly="true" /></td>
                            <td>&nbsp;</td>
                            <td><s:label>Sequence</s:label></td>
                            <td><s:if test="%{#prev!='yes'}">
                                    <s:action executeResult="false" name="get-sequence" var="la"/>
                                    <s:if test="%{#la.collection==undefined}">
                                        <s:textfield id="sequence" name="sequence" label="Sequence" value="1" readonly="true"/></td>
                                    </s:if>
                                    <s:else>
                                        <s:textfield id="sequence" name="sequence" label="Sequence" value="%{#la.collection.collectionid+1}" readonly="true"/></td>
                                </s:else>
                            </s:if>
                            <s:else>
                                <s:textfield id="sequence" name="sequence" label="Sequence" value="%{#la.collection.collectionid+1}"/></td>
                            </s:else>
                        </tr>
                        <tr>
                            <td><s:label>Document</s:label></td>
                            <td><s:textfield id="document" name="document" label="Document" readonly="true"/></td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td><s:label>Document Date</s:label></td>
                            <td><sj:datepicker id="datecoll" label="Date" name="datecoll" value=""/></td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr><td><s:label>Area Code</s:label></td>
                            <td><s:action executeResult="false" name="get-areascoll" var="a"/>
                                <s:select label="Area Code"
                                          cssClass="acode"
                                          id="acodecoll"
                                          name="acode"
                                          list="#a.areas"
                                          listKey ="areacode"
                                          listValue="areacode"
                                          headerKey="-1"
                                          emptyOption="false"
                                          cssStyle="width:150px;"
                                          headerValue="Select Area"
                                          /></td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td><s:label>Account Representative Code</s:label></td>
                            <td><s:textfield id="ccodecoll" name="ccodecoll" cssClass="ccode" label="AR Code" /></td>
                            <td><p id="errorcoll" style="display: none;color:red">Error</p></td>
                            <td><s:label>Account Representative Name</s:label></td>
                            <td><s:textfield id="cnamecoll" name="cnamecoll" label="AR Name" /></td>
                        </tr>
                    </table>
                </s:div>
            </s:form>
        </s:elseif>
    </s:if>

    <s:elseif test="%{#view!='yes'}">
        <s:form name="viewcollect" action="view-coll" cssStyle="font-size:12px;width:800px;clear:both" theme="simple">
            <s:div id="collinfo" style="float: left; width: 800px;font-size:12px;margin-left:2em;">
                <table>
                    <tr>
                        <td><s:label>Branch Code</s:label></td>
                        <td><s:textfield label="Branch Code" type="text" id="b" cssClass="branchid" readonly="true" /></td>
                        <td>&nbsp;</td>
                        <td><s:label>Sequence</s:label></td>
                        <td><s:if test="%{#prev!='yes'}">
                                <s:action executeResult="false" name="get-sequence" var="la"/>
                                <s:if test="%{#la.collection==undefined}">
                                    <s:textfield id="sequence" name="sequence" label="Sequence" value="1" readonly="true"/></td>
                                </s:if>
                                <s:else>
                                    <s:textfield id="sequence" name="sequence" label="Sequence" value="%{#la.collection.collectionid+1}" readonly="true"/></td>
                            </s:else>
                        </s:if>
                        <s:else>
                            <s:textfield id="sequence" name="sequence" label="Sequence" value="%{#la.collection.collectionid+1}"/></td>
                        </s:else>
                    </tr>
                    <tr>
                        <td><s:label>Document</s:label></td>
                        <td><s:textfield id="document" name="document" label="Document" readonly="true"/></td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td><s:label>Document Date</s:label></td>
                        <td><sj:datepicker id="datecoll" label="Date" name="datecoll" value=""/></td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr><td><s:label>Area Code</s:label></td>
                        <td><s:action executeResult="false" name="get-areascoll" var="a"/>
                            <s:select label="Area Code"
                                      cssClass="acode"
                                      id="acodecoll"
                                      name="acode"
                                      list="#a.areas"
                                      listKey ="areacode"
                                      listValue="areacode"
                                      headerKey="-1"
                                      emptyOption="false"
                                      cssStyle="width:150px;"
                                      headerValue="Select Area"
                                      /></td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td><s:label>Account Representative Code</s:label></td>
                        <td><s:textfield id="ccodecoll" name="ccodecoll" cssClass="ccode" label="AR Code" /></td>
                        <td><p id="errorcoll" style="display: none;color:red">Error</p></td>
                        <td><s:label>Account Representative Name</s:label></td>
                        <td><s:textfield id="cnamecoll" name="cnamecoll" label="AR Name" /></td>
                    </tr>
                </table>
            </s:div>
        </s:form>

    </s:elseif>

    <s:elseif test="%{#view=='yes'}">
        <s:form action="save-coll" id="bottom" cssStyle="font-size:12px;width:800px;clear:both" theme="simple" name="bottom">
            <s:div id="collinfo" style="float: left; width: 800px;font-size:12px;margin-left:2em;">
                <table>
                    <tr>
                        <s:textfield type="text" id="status" name="status" cssStyle="display:none" readonly="true" value="save"/>
                        <td><s:label>Branch Code</s:label></td>
                        <td><s:textfield label="Branch Code" type="text" id="b" cssClass="branchid" readonly="true"/></td>
                        <td>&nbsp;</td>
                        <td><s:label>Sequence</s:label></td>
                        <td><s:if test="%{#prev!='yes'}">
                                <s:action executeResult="false" name="get-sequence" var="la"/>
                                <s:if test="%{#la.collection==undefined}">
                                    <s:textfield id="sequence" name="sequence" label="Sequence" value="1" readonly="true"/></td>
                                </s:if>
                                <s:else>
                                    <s:textfield id="sequence" name="sequence" label="Sequence" value="%{#la.collection.collectionid+1}" readonly="true"/></td>
                            </s:else>
                        </s:if>
                        <s:else>
                            <s:textfield id="sequence" name="sequence" label="Sequence" value="%{#la.collection.collectionid+1}"/></td>
                        </s:else>
                    </tr>
                    <tr>
                        <td><s:label>Document</s:label></td>
                        <td><s:textfield id="document" name="document" label="Document" value="%{#request['document'].documenttype}" readonly="true"/></td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td><s:label>Document Date</s:label></td>
                        <td><input id="datecoll" label="Date" name="datecoll" value="${request.datecoll}"/></td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr><td><s:label>Area Code</s:label></td>
                        <td><s:textfield id="acodecoll" name="acodecoll" value="%{#request['area'].areacode}"/></td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td><s:label>Account Representative Code</s:label></td>
                        <td><s:textfield id="ccodecoll" name="ccodecoll" cssClass="ccode" label="AR Code" value="%{#request['emp'].idnumber}"/></td>
                        <td><p id="errorcoll" style="display: none;color:red">Error</p></td>
                        <td><s:label>Account Representative Name</s:label></td>
                        <td><s:textfield id="cnamecoll" name="cnamecoll" label="AR Name" value="%{#request['emp'].completename}"/></td>
                    </tr>
                </table>
                <br/>

            </s:div>
            <s:div id="bottomcoll" cssStyle="height:300px;width:980px;overflow:auto">

                <div>
                    <!--dito nakalagay yung save-payment-->
                    <table border="1px" cellspacing="0" id="payment" style="width:840px;font-size: 14px;margin-left:0px;border-right: none;border-top:none;border-bottom: none">
                        <thead  id="theadinput">
                            <tr>
                                <th style="width:80px;border-top-width: 2px;">Series</th>
                                <th style="width:140px;border-top-width: 2px;">Borrower Code</th>
                                <th style="width:180px;border-top-width: 2px;">Borrower Name</th>
                                <th style="width:150px;border-top-width: 2px;">Official Receipt No.</th>
                                <th style="width:120px;border-top-width: 2px;">Amount</th>
                                <th style="width:80px;border-top-width: 2px;">Payment</th>
                                <th style="border:none!important"></th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td><s:textfield id="series" value="1" disabled="false" name="series" cssStyle="display:inline" readonly="true"/></td>
                                <td><s:textfield type="text" cssClass="borrower" id="borrowercode" name="borrowercode" cssStyle="display:inline"/></td>
                                <td><sj:autocompleter list="%{#request.borrowers}"
                                                  listValue="firstlastname" id ="borrowername" name="borrowername" cssStyle="display:inline" onSelectTopics="changeborrower"/></td>
                                <td><s:textfield id ="ornum" name="ornum" cssStyle="display:inline"/></td>
                                <td><s:textfield id ="amount" name="amount" cssStyle="display:inline"/></td>
                                <td><s:select
                                        id="paymenttype"
                                        name="paymenttype"
                                        list="{'cash','check'}"
                                        emptyOption="false"
                                        cssClass="nextbtn"
                                        />
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <p id="errorinfo" style="display:none;float:left;color:white;background-color: red;font-style: italic;padding: 5px;font-size: 12px;"></p>

                </div>


                <table style="clear:both" id="hey">
                    <tr>
                        <td><s:label>Total Collection</s:label></td>
                        <td><s:textfield type="text" id="totalc" name="totalc" label="Total Collection" value="%{#request['collection'].totalamountcollected}" cssClass="money" readonly="true"/></td>
                    </tr>
                    <tr id="sectr">
                        <td><s:label>Cash Deposited</s:label></td>
                        <td><input type="text" id="cashdeposit" class="money" name="cashdeposit" label="Cash Deposited" value=""/></td>
                        <td><s:label>Deposit No.</s:label></td>
                        <td><input type="text" id="cshdepositnum" name="cshdepositnum" label="Deposit No." value=""/></td>
                        <td><s:label>Bank Account No.</s:label></td>
                        <td><s:textfield type="text" id="bankacctnum" name="bankacctnum" label="Bank Account No." value="%{#session['branch'].bankaccountnum}" readonly="true"/></td>
                    </tr>
                    <tr id="totaltr">
                        <td><s:label>Undeposited Cash</s:label></td>
                        <td><s:textfield id="cashonhand" cssClass="money" name="cashonhand" label="Undeposited Cash" value="%{#request['collection'].cashonhand}"/></td>
                    </tr>
                    <tr>
                        <td><s:label>Cash Short or (Over)</s:label></td>
                        <td><s:textfield type="text" id="cashshort" cssClass="money" name="cashshort" label="Cash Short or Over" value="%{#request['collection'].short_}" readonly="true"/></td>
                    </tr>
                </table>

                <s:div id="collsummary" style="display:none">
                    <table border="1px" cellspacing="0" id="summary" style="width:840px;background-color: white;font-size: 14px" >
                        <thead>
                            <tr>
                                <th style="width:80px">Series</th>
                                <th style="width:140px">Borrower Code</th>
                                <th style="width:180px">Borrower Name</th>
                                <th style="width:150px">Official Receipt No.</th>
                                <th style="width:120px">Amount</th>
                                <th style="width:80px">Payment</th>
                            </tr>
                        </thead>
                        <tbody id="tbodysum">
                        </tbody>
                    </table>
                </s:div>
                <%--   <sj:submit/>--%>
                <br/>
                <hr/>
                <table style="float:left">
                    <tr>
                        <th>Denomination</th>
                        <th>Pcs</th>
                        <th>Amount</th>
                    </tr>
                    <tr>
                        <td>1000</td>
                        <td><input type="text" id="1000pcs" name="thousand"/></td>
                        <td><input type="text" id="1000amt" value="0" readonly="true" style="background-color: #ddd"/></td>
                    </tr>
                    <tr>
                        <td>500</td>
                        <td><input type="text" id="500pcs" name="fivehundred"/></td>
                        <td><input type="text" id="500amt" value="0" readonly="true" style="background-color: #ddd"/></td>
                    </tr>
                    <tr>
                        <td>200</td>
                        <td><input type="text" id="200pcs" name="twohundred"/></td>
                        <td><input type="text" id="200amt" value="0" readonly="true" style="background-color: #ddd"/></td>
                    </tr>
                    <tr>
                        <td>100</td>
                        <td><input type="text" id="100pcs" name="onehundred"/></td>
                        <td><input type="text" id="100amt" value="0" readonly="true" style="background-color: #ddd"/></td>
                    </tr>
                    <tr>
                        <td>50</td>
                        <td><input type="text" id="50pcs" name="fifty"/></td>
                        <td><input type="text" id="50amt" value="0" readonly="true" style="background-color: #ddd"/></td>
                    </tr>

                </table>
                <table style="float:right">
                    <tr>
                        <th>Denomination</th>
                        <th>Pcs</th>
                        <th>Amount</th>
                    </tr>
                    <tr>
                        <td>20</td>
                        <td><input type="text" id="20pcs" name="twenty"/></td>
                        <td><input type="text" id="20amt" value="0" readonly="true" style="background-color: #ddd"/></td>
                    </tr>
                    <tr>
                        <td>10</td>
                        <td><input type="text" id="10pcs" name="ten"/></td>
                        <td><input type="text" id="10amt" value="0" readonly="true" style="background-color: #ddd"/></td>
                    </tr>
                    <tr>
                        <td>5</td>
                        <td><input type="text" id="5pcs" name="five"/></td>
                        <td><input type="text" id="5amt" value="0" readonly="true" style="background-color: #ddd"/></td>
                    </tr>
                    <tr>
                        <td>1</td>
                        <td><input type="text" id="1pcs" name="one"/></td>
                        <td><input type="text" id="1amt" value="0" readonly="true" style="background-color: #ddd"/></td>
                    </tr>
                    <tr>
                        <td><strong>Total</strong></td>
                        <td>&nbsp;</td>
                        <td><input type="text" id="totaldenomination" readonly="true" style="background-color: #ddd"/></td>
                    </tr>
                </table>
            </s:div>
        </s:form>
    </s:elseif>


    <s:if test="%{#view=='yes'}">
        <script type="text/javascript">
            $(document).ready(function(e){
                $('#btmbutton').css("margin-top","0px");
            });
        </script>
    </s:if>
    <%-- <s:div id="btmbutton" cssStyle="position:fixed;width:600px;margin-top:27em;margin-left:25em;">
         <sj:a cssClass="ui-state-default"
               button="true"
               cssStyle="float:right;margin-top:2px;font-size:14px"
               value="Save Collection"
               id="savebtn"
               >Save Collection</sj:a>
         <s:form id="getseq" action="get-seq" cssStyle="clear:left;float:right" theme="simple">
             <script type="text/javascript">
                 $(document).ready(function(){
                     $('#prev').click(function(e){
                         var sequence = $('#sequence').val();
                         if(sequence==''){
                             alert('Sequence Number is not specified');
                             document.getElementById('getseq').submit= false;
                         }else{
                             $('#sampleseqp').val(parseInt(sequence)-1);
                             document.getElementById('getseq').submit();
                         }
                     });
                                             
                     $('#nxtseq').click(function(e){
                         var sequence = $('#sequence').val();
                         if(sequence==''){
                             alert('Sequence Number is not specified');
                             document.getElementById('getseq').submit= false;
                         }else{
                             $('#sampleseqp').val(parseInt(sequence)+1);
                             document.getElementById('getseq').submit();
                         }
                     });
                                             
                 });

            </script>
            <s:textfield name="sampleseq" id="sampleseqp" cssClass="sampleseq" cssStyle="display:none;" />
            <sj:submit id="prev" button="true" cssClass="ui-state-default" cssStyle="clear:left;font-size:14px;" value="Previous"/>
            <sj:submit id="nxtseq" button="true" cssClass="ui-state-default" cssStyle="font-size:14px;" value="Next"/>
        </s:form>
        <s:form name="newcollect" action="new-coll" theme="simple">
            <sj:submit id="createnew" button="true" cssClass="ui-state-default" cssStyle="margin-left:128px;font-size:14px;" value="Create New"/>
        </s:form>

        <s:if test="%{#view!='yes'}">
            <s:div cssStyle="margin-top:-33px;margin-left:240px;margin-bottom:20em">
                <sj:a button="true" cssClass="ui-state-default" id="viewcollection" cssStyle="font-size:14px">View</sj:a>
            </s:div>
        </s:if>
        <s:else>
            <s:div cssStyle="margin-top:-33px;margin-left:219px;margin-bottom:20em">
                <sj:a button="true" value="View All" id="viewall" cssClass="ui-state-default" cssStyle="font-size:14px">View All</sj:a>
            </s:div>
        </s:else>
        <s:if test="%{#view=='yes'}">
            <s:div cssStyle="">
                <sj:a button="true" value="Print" id="printbtn" cssClass="ui-state-default" cssStyle="font-size:14px">Print</sj:a>
            </s:div>
        </s:if>
    </s:div>--%>
    <s:div id="btmbutton" cssStyle="position:fixed;width:600px;margin-top:29em;margin-left:25em;">


        <s:form id="getseq" action="get-seq" cssStyle="clear:left" theme="simple">
            <script type="text/javascript">
                $(document).ready(function(){
                    $('#prev').click(function(e){
                        var sequence = $('#sequence').val();
                        if(sequence==''){
                            alert('Sequence Number is not specified');
                            document.getElementById('getseq').submit= false;
                        }else{
                            $('#sampleseqp').val(parseInt(sequence)-1);
                            document.getElementById('getseq').submit();
                        }
                    });
                                            
                    $('#nxtseq').click(function(e){
                        var sequence = $('#sequence').val();
                        if(sequence==''){
                            alert('Sequence Number is not specified');
                            document.getElementById('getseq').submit= false;
                        }else{
                            $('#sampleseqp').val(parseInt(sequence)+1);
                            document.getElementById('getseq').submit();
                        }
                    });
                                            
                });

            </script>
            <s:textfield name="sampleseq" id="sampleseqp" cssClass="sampleseq" cssStyle="display:none;" />
            <sj:submit id="prev" button="true" cssClass="ui-state-default" cssStyle="clear:left;float:right;font-size:14px;" value="Previous"/>
            <sj:submit id="nxtseq" button="true" cssClass="ui-state-default" cssStyle="float:right;font-size:14px;" value="Next"/>
        </s:form>
        <sj:a id="searchbtn" button="true" cssClass="ui-state-default" cssStyle="float:right;font-size:14px;margin-top:2px" value="Search">Search</sj:a>
        <s:form name="newcollect" action="new-coll" theme="simple">
            <sj:submit id="createnew" button="true" cssClass="ui-state-default" cssStyle="float:right;font-size:14px;" value="Create New"/>
        </s:form>
        <sj:a button="true" 
              value="Post Collection" 
              id="postcollbtn" 
              cssClass="ui-state-default" 
              cssStyle="font-size:14px;float:right;margin-top:2px"
              >Post</sj:a>
        <sj:a cssClass="ui-state-default"
              button="true"
              cssStyle="float:right;margin-top:2px;font-size:14px"
              value="Save Collection"
              id="savebtn"
              >Save</sj:a>

        <s:if test="%{#view!='yes'}">
            <s:div cssStyle="margin-top:2px;margin-left:62px">
                <sj:a button="true" cssClass="ui-state-default" id="viewcollection" cssStyle="font-size:14px">View</sj:a>
            </s:div>
        </s:if>
        <s:else>
            <s:div cssStyle="float:right;margin-top:2px;margin-left:2px;">
                <sj:a button="true" value="View All" id="viewall" cssClass="ui-state-default" cssStyle="font-size:14px">View</sj:a>
            </s:div>
        </s:else>

    </s:div>
</s:div>